using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BaHuan.Common;
using BaHuan.Entities;
using BaHuan.DataLayer;
/*
 * There are many processes that handle the flows of data
 * we call them business logic of a program.
 * For each of business logic process we create a class 
 * that handle for that process
 * 
 * */
namespace BaHuan.BusinessLayer
{
	
	public class CTPhieuNhapKhoMgt
	{
	
		public ResultObj SaveNewCTPhieuNhapKho(CTPhieuNhapKho ctphieunhapkho)
        		{
			ResultObj result = new ResultObj();
			ctphieunhapkho.Id = -1;
			CTPhieuNhapKhoDAO ctphieunhapkhoDAO = new CTPhieuNhapKhoDAO();
			result = ctphieunhapkhoDAO.SaveCTPhieuNhapKho(ctphieunhapkho);
			
			return result;
		}
		
		public ResultObj UpdateCTPhieuNhapKho(CTPhieuNhapKho ctphieunhapkho)
        		{
			ResultObj result = new ResultObj();
			CTPhieuNhapKhoDAO ctphieunhapkhoDAO = new CTPhieuNhapKhoDAO();
			result = ctphieunhapkhoDAO.SaveCTPhieuNhapKho(ctphieunhapkho);
			
			return result;
		}
		
		public ResultObj DeleteCTPhieuNhapKho(CTPhieuNhapKho ctphieunhapkho)
        		{
			ResultObj result = new ResultObj();
			CTPhieuNhapKhoDAO ctphieunhapkhoDAO = new CTPhieuNhapKhoDAO();
			result = ctphieunhapkhoDAO.DeleteCTPhieuNhapKho(ctphieunhapkho);
			
			return result;
		}
		
		public ResultObj GetAllCTPhieuNhapKho( )
        		{
			ResultObj result = new ResultObj();
			CTPhieuNhapKhoDAO ctphieunhapkhoDAO = new CTPhieuNhapKhoDAO();
			result = ctphieunhapkhoDAO.GetAllCTPhieuNhapKho();
			
			return result;
		}
		
		public ResultObj GetCTPhieuNhapKhoById(CTPhieuNhapKho ctphieunhapkho)
        		{
			ResultObj result = new ResultObj();
			CTPhieuNhapKhoDAO ctphieunhapkhoDAO = new CTPhieuNhapKhoDAO();
			result = ctphieunhapkhoDAO.GetAllCTPhieuNhapKhoByID(ctphieunhapkho);
			
			return result;
		}

        public ResultObj GetTongHopNhapKho()
        {
            ResultObj result = new ResultObj();
            CTPhieuNhapKhoDAO ctphieunhapkhoDAO = new CTPhieuNhapKhoDAO();
            result = ctphieunhapkhoDAO.GetTongHopNhapKho();

            return result;
        }
	}
}
